Handling Movie Events
Movie controller components provide functions that handle movie controller actions. Your application must call these functions whenever an event occurs. Consider this event loop:
#if whatIsHandleEvent while (! gDoneFlag) { gResult = GetNextEvent (everyEvent, &gEventRec); if (( MCIsPlayerEvent(gMCPlay, &gEventRec) == 0 )) { if (gResult) { /* player didn't handle the event */ HandleEvent(gEventRec); } } } #endif #if 0 /* interface for application-defined routine: */ pascal Boolean MyPlayerFilter ( MovieController mc, short* action, long* params); #endifIf the movie controller component handles the event, your application can loop to wait for the next event. Otherwise, your application must take care of the event as part of its normal event handling.Movie controller components support an action filter. You can instruct the filter to invoke a function in your application whenever actions occur. This action filter function can then perform specialized processing or refer the action back to the movie controller component. The actions supported by movie controller components are discussed in "Movie Controller Actions," which begins on page 2-15.
The
MCIsPlayerEvent
function lets you pass events to a movie controller component. TheMCSetActionFilterWithRefCon
function allows you to specify your action filter function for a movie controller.You can use the
MCDoAction
function to request action processing from a movie controller.If you use any Movie Toolbox functions to change the characteristics of a movie that is associated with a movie controller, you must inform the movie controller--use the
MCMovieChanged
function.You can obtain information about the current state of the movie controller and its movie by calling the
MCGetControllerInfo
function.
Subtopics
- MCIsPlayerEvent
- MCDoAction
- MCSetActionFilterWithRefCon
- MCGetControllerInfo
- MCMovieChanged
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help